{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e5b4305f-fe27-48c9-a974-34095852e30d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "MaxPool(x).numpy()=\n",
      " [[[[3]\n",
      "   [4]]\n",
      "\n",
      "  [[4]\n",
      "   [3]]]]\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "input=tf.constant([[1,1,0,1],[3,-3,4,2],[2,0,1,3],[4,2,-1,0]])\n",
    "x=tf.reshape(input,[1,4,4,1])\n",
    "MaxPool=tf.keras.layers.MaxPool2D(pool_size=(2,2),strides=(2,2),padding='VALID')\n",
    "print(\"MaxPool(x).numpy()=\\n\",MaxPool(x).numpy())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7ae4ca50-7861-4a01-9c57-b173c2cd4661",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
